package com.crm.database.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.crm.model.BizProduct;
import com.crm.service.BizProductService;
import com.crm.util.ResponseUtil;
import com.github.pagehelper.Page;

/**
 * 高亚林
 * 2016年12月23日上午9:44:54
 */
@Controller
@RequestMapping("/professional")
public class ProfessionalController {
	
	@Autowired
	private BizProductService productService;

	@RequestMapping("/index")
	public String index(){
		return "productDatabase/professional";
	}
	
	@RequestMapping("/getAll")
	@ResponseBody
	public void getAll(HttpServletResponse response,HttpServletRequest request, Page<BizProduct> page, BizProduct t){
		
		Page<BizProduct> list = (Page<BizProduct>) productService.selectAllProfessional(page, t);
		
		ResponseUtil.resultPage(response,request,list);
	}
}
